﻿using System.Data.Common;

namespace MahaBaseWrapper.Core
{
    static  class DbHelper
    {
        private static DbProviderFactory _factory;

        public static void SetProvider(string provider)
        {
            _factory = DbProviderFactories.GetFactory(provider);
        }

        public static DbConnection CreateConnection(string connectionString)
        {
            var connection = _factory.CreateConnection();
            connection.ConnectionString = connectionString;
            
            return connection;
        }
    }
}
